<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    {% load static %}
    <script src="{% static 'jQuery-3.5.1.js' %}"></script>
    <link rel="stylesheet" href="{% static 'bootstrap-3.4.1-dist/css/bootstrap.min.css' %}">
    <script src="{% static 'bootstrap-3.4.1-dist/js/bootstrap.min.js' %}"></script>
    <script src="/static/js/csrf.js"></script>
    <link rel="stylesheet" href="/media/css/{{ blog.site_name}}.css">

    <style>

    </style>

</head>
<body>
{#导航条开始#}
   <nav class="navbar navbar-inverse">
      <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="#">{{ blog.site_title }}</a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
          <ul class="nav navbar-nav">
            <li class="active"><a href="#">博客 <span class="sr-only">(current)</span></a></li>
            <li><a href="{% url 'app01_home'%}">返回首页</a></li>
            <li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
              <ul class="dropdown-menu">
                <li><a href="#">Action</a></li>
                <li><a href="#">Another action</a></li>
                <li><a href="#">Something else here</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="#">Separated link</a></li>
                <li role="separator" class="divider"></li>
                <li><a href="#">One more separated link</a></li>
              </ul>
            </li>
          </ul>
          <form class="navbar-form navbar-left">
            <div class="form-group">
              <input type="text" class="form-control" placeholder="Search">
            </div>
            <button type="submit" class="btn btn-default">Submit</button>
          </form>
          <ul class="nav navbar-nav navbar-right">
              {% if request.user.is_authenticated %}
                    <li><a href="#">用户站点：{{username }}</a></li>
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                          更多操作 <span class="caret"></span></a>
                      <ul class="dropdown-menu"> <!--通过模态框的id来触发模态框-->
                        <li><a href="#"  data-toggle="modal"  data-target="#myModel">修改密码</a>

                        </li>
                        <li><a href="#">修改头像</a></li>
                        <li><a href="#">后台管理</a></li>
                        <li role="separator" class="divider"></li>
                        <li><a href="{% url 'app01_logout' %}">退出登录</a></li>

                      </ul>
                         {#修改密码模态框开始#}
                            <!--模态框生效的关键： data-toggle="modal" data-target=".bs-example-modal-lg" id ='Mymodel' -->
                        <div class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" id="myModel">
                          <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content">
                                <div class="container">
                                    <div class="row">
                                        <div class="col-md-6 col-md-offset-2">
                                            <h2 class="text-center">修改密码</h2>
                                        </div>
                                    </div>

                                    <div class="row">
                                        <div class="col-md-6 col-md-offset-2">
                                            <div class="form-group">
                                                <label for="set_user">用户名</label>
                                                <input type="text" disabled id="set_user" value="{{ username }}" class="form-control">

                                            </div>
                                            <div class="form-group">
                                                 <label for="id_old_pwd">原密码</label>
                                                <input type="password"  id="id_old_pwd" class="form-control">


                                            </div>
                                            <div class="form-group">
                                                <label for="id_new_pwd">新密码</label>
                                                <input type="password"  id="id_new_pwd" class="form-control">

                                            </div>
                                            <div class="form-group">
                                                <label for="id_confirm_pwd">确认密码</label>
                                                <input type="password"  id="id_confirm_pwd" class="form-control">

                                            </div>
                                            <p> <span style="color: red" id="error"></span></p>
                                            <button class="btn btn-success btn-sm" id="id_editer" >确定修改</button>
                                            <button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">取消修改</button>
                                            <br>
                                            <br>


                                        </div>

                                    </div>
                                </div>
                            </div>
                          </div>
                        </div>
                        {#修改密码模态框结束#}

                </li>
              {% else %}

                    <li><a href="{% url 'app01_register' %}">注册</a></li>
                    <li><a href="{% url 'app01_login' %}">登录</a></li>
              {% endif %}


          </ul>
        </div><!-- /.navbar-collapse -->
      </div><!-- /.container-fluid -->
</nav>
{#导航条结束#}

{#页面布局开始#}
<div class="container">
    <div class="row">
{#页面左布局开始        #}
        <div class="col-md-2">

          {% load my_tag %}
            {% left_menu username %}

        </div>
{#页面右布局结束        #}
    {% block content %}
{#页面右布局开始#}
        {#        文章展示开始#}
        <div class="col-md-10">
            {% for page in c_page %}


                     <div class="media">
                      <h4 class="media-heading"><a href="#">{{ page.title }}</a> </h4>
                      <div class="media-left">

                        <a href="#">
                          <img class="media-object" src="/media/{{ user_obj.avatar }}" alt="加载中" height="64" width="64">
                        </a>

                      </div>

                  <div class="media-body">
                      <div class="row">

                               <p> {{ page.desc }}</p>
                                <p>{{ page.content }}</p>

                      </div>
                      <div class="row ">
                          <div class="row">
                              <div class="col-md-6 float-right"></div>
                              <div class="col-md-6 float-right">
                                  &nbsp;&nbsp;&nbsp;&nbsp;发布于：{{ page.create_time }}&nbsp;&nbsp;
                                  <a href="#">点赞 <span class="glyphicon glyphicon-thumbs-up">1</span></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                  <a href="#"> 踩他<span class="glyphicon glyphicon-thumbs-down">2</span></a>&nbsp;&nbsp;&nbsp;&nbsp;
                                  <a href="#">评论<span class="glyphicon glyphicon-pencil">3</span></a>

                              </div>
                          </div>




                      </div>
                  </div>
                </div>

                <hr>
            {% endfor %}
        </div>
        {#    文章展示结束#}

        <!--页码的开始-->
            <div class="pager">
                 <nav aria-label="Page navigation">
                  <ul class="pagination">
                        {{ page_html}}
                  </ul>
                </nav>
            </div>
        <!--页码的结束-->
{#页面右布局结束  #}
    {% endblock %} <!--文章详情表页继承该面版页，就修改右边布局-->

    </div>
</div>


{#页面布局结束#}


</body>
</html>